package com.ggggeeennn.question.mapper;

import com.ggggeeennn.exam.domain.PaperParam;
import com.ggggeeennn.question.domain.CourseQuestionCount;
import com.ggggeeennn.question.domain.Question;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 题库管理Mapper接口
 * 
 * @author ggggeeennn
 * @date 2025-06-28
 */
public interface QuestionMapper
{


    //根据课程查询课表题库
    public List<CourseQuestionCount> countQuestionsByCourse(Question question);
    /**
     * 查询题库管理
     * 
     * @param questionId 题库管理主键
     * @return 题库管理
     */

    public Question selectJudgeQuestionByQuestionId(Long questionId);
    public Question selectMultiQuestionByQuestionId(Long questionId);
    public Question selectFillQuestionByQuestionId(Long questionId);

    /**
     * 查询题库管理列表
     * 
     * @param question 题库管理
     * @return 题库管理集合
     */
    public List<Question> selectQuestionList(Question question);

    /**
     * 新增题库管理
     * 
     * @param question 题库管理
     * @return 结果
     */
    public int insertJudgeQuestion(Question question);
    public int insertMultiQuestion(Question question);
    public int insertFillQuestion(Question question);

    /**
     * 修改题库管理
     * 
     * @param question 题库管理
     * @return 结果
     */
    public int updateJudgeQuestion(Question question);

    public int updateMultiQuestion(Question question);
    public int updateFillQuestion(Question question);

    /**
     * 删除一个题库
     * 
     * @param questionId 题库管理主键
     * @return 结果
     */
    public int deleteJudgeQuestionByQuestionId(Long questionId);
    public int deleteMultiQuestionByQuestionId(Long questionId);
    public int deleteFillQuestionByQuestionId(Long questionId);


    /**
     * 批量删除题库管理
     * 
     * @param questionIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteJudgeQuestionByQuestionIds(Long[] questionIds);
    public int deleteMultiQuestionByQuestionIds(Long[] questionId);
    public int deleteFillQuestionByQuestionIds(Long[] questionId);


    public List<Question> selectJudgeQuestionListByIds(@Param("questionIds")List<Integer> questionIds, @Param("paperParam")PaperParam paperParam);
    public List<Question> selectMultiQuestionListByIds(@Param("questionIds")List<Integer> questionIds, @Param("paperParam")PaperParam paperParam);
    public List<Question> selectFillQuestionListByIds(@Param("questionIds")List<Integer> questionIds, @Param("paperParam")PaperParam paperParam);

    public List<Question> selectCombinedQuestions(@Param("judgeIds") List<Integer> judgeIds,
                                                  @Param("multiIds")List<Integer> multiIds,
                                                  @Param("fillIds") List<Integer> fillIds,
                                                  @Param("paperParam")PaperParam paperParam);
}
